import random
import random


def game1():  # 石头剪刀布
    # 三局两胜
    i = 0
    j = 0
    for x in range(3):
        player = input("请输入石头剪刀布：")
        a = ['石头', '剪刀', '布']
        bot = random.choice(a)
        print("对方出了", bot)
        if player == bot:
            print("平局")
        elif ((player == '石头' and bot == '剪刀')
              or (player == '剪刀' and bot == '布')
              or (player == '布' and bot == '石头')):
            i += 1
            print("你赢了")
        else:
            j += 1
            print("你输了")

    print("进行结算：你赢了%d局，对方赢了%d局" % (i, j))
    if i > j:
        print("本轮结束，你赢了")
    elif i < j:
        print("本轮结束，你输了")
    else:
        print("本轮结束，平局")


# game1()

# 猜数字，电脑显大了，还是小了，直到猜对为止
def guess_number():
    num = random.randint(1,100)
    while True:
        n = int(input("请猜数字："))
        if num == n:
            print("猜对了")
            break
        elif n > num:
            print("猜大了")
        else:
            print("猜小了")

# guess_number()